package com.lin.socketio.event;

import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.SocketIOClient;
import com.lin.common.error.CustomRuntimeException;
import com.lin.socketio.dto.ChatObject;
import com.lin.po.Customer;
import com.lin.po.Ranges;
import com.lin.properties.ConsumeProperties;
import com.lin.service.ranges.RangesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class EncounterNamespaceHandler implements SocketHandler {
    private static Logger log = LoggerFactory.getLogger(EncounterNamespaceHandler.class);
    @Autowired
    private RangesService rangesService;

    @Autowired
    ConsumeProperties consumeProperties;

    @Override
    public void connect(SocketIOClient client, Customer c) {
        Set<Ranges> set = rangesService.listrange(c);
        log.info("set's size:{}",set.size());

    }

    @Override
    public void event(SocketIOClient client, ChatObject data, AckRequest ackSender) throws CustomRuntimeException {

    }

    @Override
    public void disconnect(SocketIOClient client) {

    }
}
